package com.example.message;

import lombok.Data;

import java.io.Serializable;

/*
 * @className: MqRetrun
 * @author: chentao
 * @date: 2025/2/26 上午9:09
 * @Version: 1.0
 * @description: mq消费数据信息
 */
@Data
public class MqMessageReturn implements Serializable {

    private boolean success = true;

    private String msg;

    /***
     * 消息消费成功
     * @return
     */
    public static MqMessageReturn success() {
        return new MqMessageReturn();
    }

    /***
     * 消息消费失败
     * @param msg
     * @return
     */
    public static MqMessageReturn error(String msg) {
        MqMessageReturn mqMessageReturn = new MqMessageReturn();
        mqMessageReturn.setSuccess(false);
        mqMessageReturn.setMsg(msg);
        return mqMessageReturn;
    }
}
